<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
      list-style: none;
    }
    html,body{
      background-color: #000;
    }
    .wrap{
      width: 630px;
      height: 394px;
      border: 1px solid white;
      margin: 40px auto;
      overflow: hidden;
      padding: 10px 0 0 10px;
    }
    .wrap li{
      float: left; 
      margin: 0 10px 10px 0;
    }
    .wrap img{
      display: block;
    }
  </style>
</head>
<body>
  <script src="../../jquery-1.12.4.min.js"></script>
  <script>
    // jQuery 入口函数
    $(function(){
      var $lis = $('li');
      $lis.mouseenter(function(){
        $(this).css('opacity',1).siblings().css('opacity',0.5);//siblings()获取同级元素/标签选择器
      });
      $('.wrap').mouseleave(function(){
        //方法一
        $lis.css('opacity',1);
        //方法二
        $(this).find("li").css("opacity", 1);//find()后代选择器
      })
    });
  </script>
  <div class="wrap">
    <ul>
      <li><a href="javascript:;"><img src="images/01.jpg" alt=""></a></li>
      <li><a href="javascript:;"><img src="images/02.jpg" alt=""></a></li>
      <li><a href="javascript:;"><img src="images/03.jpg" alt=""></a></li>
      <li><a href="javascript:;"><img src="images/04.jpg" alt=""></a></li>
      <li><a href="javascript:;"><img src="images/05.jpg" alt=""></a></li>
      <li><a href="javascript:;"><img src="images/06.jpg" alt=""></a></li>
    </ul>
  </div>
</body>
</html>